package com.mmy.service.oa.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mmy.dao.oa.MaterialOutRepository;
import com.mmy.dao.oa.VMaterialOutRepository;
import com.mmy.domain.oa.MaterialOut;
import com.mmy.domain.oa.VMaterialOut;
import com.mmy.service.oa.MaterialOutService;

@Service
public class MaterialOutServiceImpl implements MaterialOutService {

	@Autowired
	private MaterialOutRepository materialOutRepository;

	@Autowired
	private VMaterialOutRepository vMaterialOutRepository;

	/**
	 * 查找全部
	 * 
	 * @param
	 * @return
	 */
	public List<VMaterialOut> findAll() {
		// TODO Auto-generated method stub
		return vMaterialOutRepository.findAll();
	}

	/**
	 * 获取最大值
	 * 
	 * @param
	 * @return
	 */
	public Object getMaxOutID() {
		// TODO Auto-generated method stub
		return materialOutRepository.getMaxOutID();
	}

	/**
	 * 新增
	 * 
	 * @param
	 * @return
	 */
	public void save(MaterialOut materialOut) {
		// TODO Auto-generated method stub
		materialOutRepository.save(materialOut);
	}

	/**
	 * 删除
	 * 
	 * @param
	 * @return
	 */

	public void delMaterialOut(List<Integer> lstOutID) {
		// TODO Auto-generated method stub
		materialOutRepository.delMaterialOut(lstOutID);
	}

	/**
	 * 通过id查找
	 * 
	 * @param
	 * @return
	 */
	public MaterialOut findByOutID(int iOutID) {
		// TODO Auto-generated method stub
		return materialOutRepository.findByOutID(iOutID);
	}

	/**
	 * 新增id
	 * 
	 * @param
	 * @return
	 */
	public void save(int outID) {
		// TODO Auto-generated method stub
		materialOutRepository.save(outID);
	}

	/**
	 * 通过name查找
	 * 
	 * @param
	 * @return
	 */
	public List<VMaterialOut> findByMaterialName(String strMaterialName) {
		// TODO Auto-generated method stub
		return vMaterialOutRepository.findByMaterialName(strMaterialName);
	}
}
